/*
This file is part of SmartShopper

SmartShopper is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

SmartShopper is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with vlc-remote.  If not, see <http://www.gnu.org/licenses/>.
*/

import QtQuick 1.0
import com.meego 1.0

ToolBarLayout {
    id: commonTools
    visible: true
    smooth: true
    ToolIcon {
        platformIconId: "toolbar-back";
        onClicked: { myMenu.close(); pageStack.pop(); }
//            visible: pageStack.currentPage != mainPage
    }

    ToolIcon {
        id: iconHome
        platformIconId: "toolbar-home"
        onClicked: { myMenu.close(); pageStack.pop(mainPage) }
//            visible: pageStack.currentPage != mainPage
    }

    ToolIcon {
        id: iconHelp
        iconSource: "icons/user-guide.png"
        onClicked: { myMenu.close(); pageStack.push(helpPage, {displayedText: pageStack.currentPage.helpText}) }
        // TODO pageStack is not accessible from here ?
        visible: pageStack.currentPage != helpPage
    }

    ToolIcon {
        platformIconId: "toolbar-view-menu";
        anchors.right: parent === undefined ? undefined : parent.right
        onClicked: (myMenu.status == DialogStatus.Closed) ? myMenu.open() : myMenu.close()
    }
}
